﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var moneytypeData = Jxstar.findComboData('moneytype');
	var projectjdData = Jxstar.findComboData('projectjd');
	var planyearData = Jxstar.findComboData('planyear');
	var baotypeData = Jxstar.findComboData('baotype');
	var auditData = Jxstar.findComboData('audit');
	var plantype2Data = Jxstar.findComboData('plantype2');
	var planstatus2Data = Jxstar.findComboData('planstatus2');
	var yesnoData = Jxstar.findComboData('yesno');
	var planstatusData = Jxstar.findComboData('planstatus');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'项目名称', name:'money_plan__plan_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'combo', fieldLabel:'项目类别', name:'money_plan__money_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: moneytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: moneytypeData[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'预计总投资(万元)', name:'money_plan__plan_money', defaultval:'0', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'累计完成投资(万元)', name:'money_plan__sun_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'下年计划投资(万元)', name:'money_plan__year_money', defaultval:'0', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'投资计划批复文号', name:'money_plan__check_fileno', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'numberfield', decimalPrecision:2, fieldLabel:'合同金额(万元)', name:'money_plan__money_contract', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'combo', fieldLabel:'当前形象进度', name:'money_plan__project_process',
						anchor:'100%', editable:false, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*',
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: projectjdData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: projectjdData[0][0]},
					{xtype:'combo', fieldLabel:'预算年度', name:'money_plan__plan_year',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: planyearData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: planyearData[0][0]},
					{xtype:'combo', fieldLabel:'计划包属性', name:'money_plan__bao_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: baotypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: baotypeData[0][0]},
					{xtype:'textfield', fieldLabel:'计划编号', name:'money_plan__plan_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'hidden', fieldLabel:'主键', name:'money_plan__plan_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'申报部门ID', name:'money_plan__dept_id', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'money_plan__audit_up', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'combo', fieldLabel:'国家局项目类别', name:'money_plan__money_type2',
						anchor:'100%', editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: plantype2Data
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: plantype2Data[0][0]},
					{xtype:'combo', fieldLabel:'项目状态', name:'money_plan__plan_status2',
						anchor:'100%', editable:false, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*',
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: planstatus2Data
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: planstatus2Data[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'立项批复金额(万元)', name:'money_plan__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'开工日期', name:'money_plan__project_sdate', format:'Y-m-d', anchor:'100%'},
					{xtype:'datefield', fieldLabel:'竣工日期', name:'money_plan__project_edate', format:'Y-m-d', anchor:'100%'},
					{xtype:'datefield', fieldLabel:'立项批复日期', name:'money_plan__project_checkdate', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'combo', fieldLabel:'是否上报国家局', name:'money_plan__up_comp',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: yesnoData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: yesnoData[0][0]},
					{xtype:'textfield', fieldLabel:'申报部门', name:'money_plan__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'结转日期', name:'money_plan__tran_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'combo', fieldLabel:'计划状态', name:'money_plan__plan_status', defaultval:'11',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: planstatusData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: planstatusData[0][0]},
					{xtype:'hidden', fieldLabel:'是否结转', name:'money_plan__is_turn', defaultval:'0', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目id', name:'money_plan__project_id', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'建设内容及方案', name:'money_plan__plan_desc', width:'100%', height:48, maxLength:4000},
					{xtype:'textarea', fieldLabel:'年度项目实施内容', name:'money_plan__year_content2', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'money_tran_up'
	};

	
	config.initpage = function(formNode){		var form = formNode.page.getForm();			var event = formNode.event;		event.on('beforedelete', function(fe) {			var deptid = fe.form.get('money_plan__dept_id');			if (deptid.length > 0 && deptid.substring(0, 4) != '1001') {				JxHint.alert('不能执行此操作，您选择的记录中包含了厂内的计划，\n本功能只能新增公司本部的计划，所以也只能删除公司本部的计划！');					return false;			}		});	};
	
	return new Jxstar.FormNode(config);
}